<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var arr = [1,2,3,4,5,6,7,8,9]
			var arr1 = []
			var arr2 = []
			for(var i = 0; i < arr.length; i++){
				if(arr[i] % 2 == 0){
					arr1.push(arr[i])
				}else{
					arr2.push(arr[i])
				}
			}
			console.log(arr2)
			arr1.sort(function(a,b){
				return a-b
			})
			console.log(arr1)
			arr2.sort(function(a,b){
				return b-a
			})
			console.log(arr2)
			if(arr1[0] !== 0 && arr2[0] !== 0){
				alert(arr1[0] + arr2[0])
			}else{
				alert('null')
			}
		</script>
	</body>
</html>
